package metier;

import java.io.Serializable;
import java.util.ArrayList;
import metier.Candidature;
import metier.Entreprise;
import metier.Etudiant;
import metier.Stage;


public class Departement implements Serializable {
	
	private static final long serialVersionUID = 6190919002365605842L;
	
	private int reference = -1;
	private String nom;
	private String login;
	private String mdp;
	
	private ArrayList<Stage> listeStage = new ArrayList<Stage>();
	private ArrayList<Etudiant> listeEtudiant = new ArrayList<Etudiant>();
	private ArrayList<Entreprise> listeEntreprise = new ArrayList<Entreprise>();
	
	public Departement(int ref, String nom)
	{
		this.reference = ref;
		this.nom = nom;
	}
	
	public Departement(String nom)
	{
		this.reference = -1;
		this.nom = nom;
		this.login = nom;
		this.mdp = "123";
	}
	
	public Departement(String nom, String login, String mdp)
	{
		this.nom = nom;
		this.login = login;
		this.mdp = mdp;
	}
	
	public Departement ()
	{
	}
	
	public int getReference()
	{
		return this.reference;
	}
	
	public String getNom()
	{
		return this.nom;
	}
	
	public void setReference(int ref)
	{
		this.reference = ref;
	}
	
	public void setNom(String nom)
	{
		this.nom = nom;
	}
	
	public ArrayList<Stage> listeNouveauxStage() 
	{
		/*a remplire*/
		return listeStage;
	}
	
	public boolean validerStage(Stage stage)
	{
		stage.setValideDepartement(true);
		return stage.getValideDepartement();
	}
	
	public void refuserStage(Stage stage)
	{
		
	}
	
	public boolean validerCandidature(Candidature candidature)
	{
		candidature.setValideDepartement(true);
		return candidature.getValideDepartement();
	}
	
	public ArrayList<Etudiant> listeValideStage()
	{
		/*a remplir*/
		return listeEtudiant;
	}
	
	public Etudiant enregistrerEtudiant(Etudiant etudiant)
	{
		/*a remplirs*/
		return etudiant;
	}
	
	public ArrayList<Stage> consulterListeStage()
	{
		/*a remplis*/
		return listeStage;
	}
	
	public ArrayList<Entreprise> consulterListeEntreprisesStage()
	{
		/*a remplirs*/
		return listeEntreprise;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getMdp() {
		return mdp;
	}

	public void setMdp(String mdp) {
		this.mdp = mdp;
	}

	@Override
	public String toString() {
		return "Departement [ref : " + reference + " | nom : " + nom + " | login = " + login + " | mdp : " + mdp + " ]"; 
	}
}
